package com.edu.www;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;

import io.appium.java_client.android.AndroidDriver;

public class BaseDriver {

	protected AndroidDriver driver = null;
	String urlStr = "http://127.0.0.1:4723/wd/hub";

	@BeforeClass
	public void initDriver() throws MalformedURLException {
	
		DesiredCapabilities cap = new DesiredCapabilities();
		cap.setCapability("platformName", "Android");
		cap.setCapability("deviceName", "127.0.0.1:62001");
//		//yibijizhang
//		cap.setCapability("appPackage", "com.mobivans.onestrokecharge");
//		cap.setCapability("appActivity", ".activitys.BootActivity");
		//xuanxuan 
		cap.setCapability("appPackage", "com.cnezsoft.xxm");
		cap.setCapability("appActivity", ".MainActivity");
		cap.setCapability("noReset", true);		
		driver = new AndroidDriver(new URL(urlStr),cap);
	}
	
	@AfterClass
	public void quiteDriver() {
		
	}
	

}
